  function urlServerPath(url){
    url = url.replace(/^\s+|\s+$/g,"");
    var slIndex = url.lastIndexOf('/');
    var qtIndex = url.lastIndexOf('?');
    var phpIndex = url.lastIndexOf('.php');
    if (slIndex + 1 == url.length){
      return url;
    }
    if (qtIndex > -1 || phpIndex > -1){
      return url.substring(0,slIndex+1);
    }else{
      return url + "/";
    }
  }

  function createProxyURL(target){
    return "index.php?module=YellowPHP&type=user&func=proxy&url=" + Url.encode(target) + "&encode=rawurlencode&r=" + genSession();
  }

  function trim(str) {
    return str.replace(/^\s+|\s+$/g,"");
  }
  function genSession(){
    return Math.random(999);
  }
  function JSONToObject(str){
    return eval('(' + str + ')');
  }
  function showLoading(element_id,visible){
    var obj = document.getElementById(element_id);
    if (visible == true)
    {
      var img = "modules/YellowPHP/pnimages/loader.white.gif";
      obj.innerHTML = "<img src='"+ img +"' />";
    }else{
      obj.innerHTML = "";
    }
  }